package cave;

import android.util.Log;
import cave.game.GameServices;
import cave.game.MainActivity;
import cave.layer.Layer;
import cave.layer.LayerManager;

public class LayerFactory {
	
	private LayerManager layerManager;
	private GameServices gameServices;
	
	public LayerFactory(LayerManager layerManager, GameServices gameServices) {
		this.layerManager = layerManager;
		this.gameServices = gameServices;
	}
	
	// APPLICATION SPECIFIC CONTETNT
	public String[] getStartLayerIDs() {
		String[] startList = {ParallaxLayer.LAYER_ID, MainMenuLayer.LAYER_ID};
		return startList;
	}
	
	// APPLICATION SPECIFIC CONTETNT
	public Layer createLayer(String id) {
		if (id.equals(MainMenuLayer.LAYER_ID)) {
			return new MainMenuLayer(layerManager, gameServices);
		} else if (id.equals(OptionsMenuLayer.LAYER_ID)) {
			return new OptionsMenuLayer(layerManager, gameServices);
		} else if (id.equals(ParallaxLayer.LAYER_ID)) {
			return new ParallaxLayer(gameServices);
		}
		Log.w(MainActivity.TAG, "LayerFactory.createLayer: no layer found with id \""+id+"\"");
		return null;
	}

}
